﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Zone4SI
{
    public partial class AssignBibs : Form
    {
        public int BibNumber { get; set; }
        private int m_bibNumber;

        public AssignBibs()
        {
            m_bibNumber = BibNumber = 0;
            InitializeComponent();
        }

        private void AssignBibs_Load(object sender, EventArgs e)
        {
            if (BibNumber != 0)
            {
                this.tbFirstBibNumber.Text = BibNumber.ToString();
                btnOK.Enabled = true;
            }
            else
                btnOK.Enabled = false;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            BibNumber = m_bibNumber;
        }

        private void tbFirstBibNumber_TextChanged(object sender, EventArgs e)
        {
            bool resp = int.TryParse(tbFirstBibNumber.Text, out m_bibNumber);
            btnOK.Enabled = (resp == true);
        }

    }
}
